From 7b92801c92a63b4c026d80e7a2353a9ca9cc6ffe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Oct 2006 13:12:42 +0000 Subject: [PATCH] (rmail-redecode-body): If the old encoding is `undecided', call find-coding-systems-region to find a proper non-trivial encoding. --- lisp/mail/rmail.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 473175e142b..b196d906f81 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -2875,6 +2875,12 @@ iso-8859, koi8-r, etc." (coding-system-change-eol-conversion coding (coding-system-eol-type old-coding))) + ;; If old-coding is `undecided', encode-coding-region + ;; will not encode the text at all. Find a proper + ;; non-trivial encoding to use. + (if (memq (coding-system-base old-coding) '(nil undecided)) + (setq old-coding + (car (find-coding-systems-region msgbeg msgend)))) (setq x-coding-header (point-marker)) (narrow-to-region msgbeg msgend) (encode-coding-region (point) msgend old-coding) -- 2.30.2